<?php

namespace App\Http\Controllers;

//use Illuminate\Http\Request;
use Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use App\Models\Book;
use App\Models\Shudan;
use App\Models\UsersReg;
use App\Models\BooksReview;
use Session;
use Redirect;

class ShupingController extends Controller
{

    public function shupinglist()
    {
        //全部书评列表
        $booksreviews = BooksReview::orderBy('id', 'desc')->paginate(10);
        foreach($booksreviews as $booksreview)
        {
            //为了得到图书的信息
            $booksreview['books'] = $booksreview->hasOnebooks;
        }
        foreach ($booksreviews as $reviewuser) {
            //得到发布长评论的会员资料
            $reviewuser['users'] = $reviewuser->hasOnUsersReg;
        }
        return view('books.layouts.shupinglist', array('booksreviews' => $booksreviews));
    }
    
}
